<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="逯灿灿">
    <title>消费订单</title>
    <style>
    *{
        box-sizing: border-box;
    }
    .box{
        width: 800px;
        height: 800px;
        margin: 0 auto;
        border: 1px solid black;
    }
    .choice{
        width: 350px;
        height: 50px;
        margin: 50px auto;
        display: flex;
        text-align: center;
        position: relative;
    }
    .choice-one{
        width: 175px;
        height: 50px;
        background-color: goldenrod;
        line-height: 50px;
        position: relative;
    }
    .choice-two{
        width: 175px;
        height: 50px;
        background-color: gray;
        line-height: 50px;
        position: relative;
    }
    .choice div ul{
        width: 175px;
        background-color: white;
        border: 1px solid black;
        position: absolute;
        margin: 0;
        padding: 0;
        list-style: none;
        top: 50px;
        display: none;
    }
    .choice div ul li{
        width: 173px;
        height: 50px;
        line-height: 50px;
        border-bottom: 1px solid rgba(100, 100, 100, 0.5); 
    }
    .message{
        width: 350px;
        height: 50px;
        text-align: center;
        margin: 280px auto;
    }
    </style>
</head>

<body>
    <div class="box">
        <div class="choice">
            <div class="choice-one">销售订单
                <ul class="show">
                    <li>销售1</li>
                    <li>销售2</li>
                    <li>销售3</li>
                    <li>销售4</li>
                </ul>
            </div>
            <div class="choice-two">消费订单
                <ul class="show">
                    <li>销费1</li>
                    <li>销费2</li>
                    <li>销费3</li>
                    <li>销费4</li>
                </ul>
            </div>
        </div>
        <div class="message">
            信息
        </div>
    </div>
    <script src="./js/jquery.js"></script>
</body>

</html>
<script>
    var choice = $('.choice').children('div');
    var show = $('.choice div').children('.show');
    var list = $('.choice div ul').children('li');
    var message = $('.message');

    choice.hover(function(){
        var count = choice.index(this);
        if(count == 0){
            show.eq(0).css('display','block');
            show.eq(1).css('display','none');
        }
        if(count == 1){
            show.eq(1).css('display','block');
            show.eq(0).css('display','none');
        } 
        
    },function(){
        show.css('display','none');
    });

    list.hover(function(){
            $(this).css('background-color','gray');
            $(this).click(function(){
                message.html($(this).html());
                show.css('display','none');
            });
    },function(){
            $(this).css('background-color','white');
    });

</script>